package JVM.chapter02.classLoader;

import java.sql.DriverManager;

/**
 * 如何获取类加载器
 */
public class HowToGetClassLoader {
    public static void main(String[] args) throws ClassNotFoundException {
        // 方法1: 获取当前类获取
        ClassLoader classLoader1 = Class.forName("java.lang.String").getClassLoader();

        // 方法2: 从当前线程获取
        ClassLoader classLoader2 = Thread.currentThread().getContextClassLoader();

        // 方法3:
        ClassLoader classLoader3 = ClassLoader.getSystemClassLoader();


    }
}
